/// 结构体 (类似java 的 pojo)
use serde::{Deserialize, Serialize};
use tokio_pg_mapper_derive::PostgresMapper;

//response返回结果
#[derive(Serialize)]
pub struct Status {
    pub status: String,
}

// mapping pgsql的todo_list表
#[derive(Serialize, Deserialize, PostgresMapper)]
#[pg_mapper(table = "todo_list")]
pub struct TodoList {
    pub id: i32,
    pub title: String,
}

// mapping pgsql的todo_item表
#[derive(Serialize, Deserialize, PostgresMapper)]
#[pg_mapper(table = "todo_item")]
pub struct TodoItem {
    pub id: i32,
    pub title: String,
    pub checked: bool,
    pub list_id: i32,
}

#[derive(Deserialize)]
pub struct CreateTodoList{
    pub title: String,
}

#[derive(Serialize)]
pub struct ResultResponse{
    pub success: bool,
}